home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / listview.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.4 KB  |  102 lines

  1. /* */
  2.  
  3. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  4. if AddLibrary("rxmui.library")~=0 then exit
  5.  
  6. lv.list="l"
  7. lv.input=1
  8. lv.frame="INPUTLIST"
  9. l.format="COL=0 BAR,COL=1"
  10.  l.0="Alfonso|1"
  11.  l.1="Paolo|2"
  12.  l.2="Emi|3"
  13. res=newobj("listview","lv")
  14. if res~=0 then call err(res)
  15.  
  16. app.Title="ListExample"
  17. app.Version="$VER: ListExample 1.0 (22.11.99)"
  18. app.Copyright="©1999, alfie"
  19. app.Author="alfie"
  20. app.Description="List Example"
  21. app.Base="SHOW"
  22. app.SubWindow="WIN"
  23.  win.Title="ListExample"
  24.  win.ID="SHOW"
  25.  win.Contents="MGROUP"
  26.   mgroup.0="lv"
  27.   mgroup.1="G"
  28.    g.class="GROUP"
  29.    g.horiz=1
  30.     g.0=Button("SORT","_Sort")
  31.     g.1=Button("ADD","_Add")
  32.     g.2=Button("REMOVE","_Remove")
  33.   mgroup.2="GG"
  34.    gg.class="GROUP"
  35.    gg.horiz=1
  36.     sa.reject="|";gg.0=String("SA")
  37.     sb.reject="|";gg.1=String("SB")
  38.  
  39. res=NewObj("application","app")
  40. if res~=0 then call err(res)
  41.  
  42. res=Notify("win","closerequest",1,"app","returnid","quit")
  43. if res~=0 then call err(res)
  44.  
  45. res=Notify("sort","pressed",0,"lv","sort")
  46. if res~=0 then call err(res)
  47.  
  48. res=Notify("add","pressed",0,"lv","insert","","bottom")
  49. if res~=0 then call err(res)
  50.  
  51. res=Notify("add","pressed",0,"lv","set","active","bottom")
  52. if res~=0 then call err(res)
  53.  
  54. res=Notify("remove","pressed",0,"lv","remove","active")
  55. if res~=0 then call err(res)
  56.  
  57. res=Notify("lv","activeentry","everytime","app","returnid")
  58. if res~=0 then call err(res)
  59.  
  60. res=Notify("lv","active",-1,"sa","set","contents","")
  61. if res~=0 then call err(res)
  62.  
  63. res=Notify("lv","active",-1,"sb","set","contents","")
  64. if res~=0 then call err(res)
  65.  
  66. res=Notify("lv","activeentry0","everytime","sa","set","contents","triggervalue")
  67. if res~=0 then call err(res)
  68.  
  69. res=Notify("lv","activeentry1","everytime","sb","set","contents","triggervalue")
  70. if res~=0 then call err(res)
  71.  
  72. res=Notify("sa","newcontents","everytime","lv","replacecol","active",0,"triggervalue")
  73. if res~=0 then call err(res)
  74.  
  75. res=Notify("sb","newcontents","everytime","lv","replacecol","active",1,"triggervalue")
  76. if res~=0 then call err(res)
  77.  
  78. call set("lv","active",0)
  79.  
  80. res=set("win","defaultobject","lv")
  81. if res~=0 then call err(res)
  82.  
  83. res=set("win","open",1)
  84. if res~=0 then call err(res)
  85.  
  86. s=0
  87. do forever
  88.     call handle("APP","H",s)
  89.     do i=0 to h.num-1
  90.         say h.num-1 h.i
  91.         if h.i="QUIT" then exit
  92.     end
  93.     s=Wait(or(h.signals,2**12))
  94.     if and(s,2**12)~=0 then exit
  95. end
  96. exit
  97.  
  98. err: procedure expose sigl
  99. parse arg res
  100.     say getrxmuistring(res) "in line" sigl-1
  101.     exit
  102.